//
//  UserDetail.m
//  iHeima
//
//  Created by WL-DZ-PGDN-007 on 14-7-3.
//  Copyright (c) 2014年 leon. All rights reserved.
//

#import "UserDetail.h"

@interface UserDetail ()

@end

@implementation UserDetail

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}


#pragma mark - Signal

ON_CREATE_VIEWS( signal )
{
    self.title = self.dictUser[@"username"];
    self.navigationController.navigationBarHidden = NO;
    [self showBarButton:BeeUINavigationBar.LEFT image:IMAGESTRING(@"navi_back")];
    [self showNaviBar];
    [self loadContent];
}

ON_DELETE_VIEWS( signal )
{
}

ON_LAYOUT_VIEWS( signal )
{
}

ON_WILL_APPEAR( signal )
{
    [self.navigationController setNavigationBarHidden:NO animated:YES];
}

ON_DID_APPEAR( signal )
{
}

ON_WILL_DISAPPEAR( signal )
{
}

ON_DID_DISAPPEAR( signal )
{
}

ON_SIGNAL3( BeeUINavigationBar, LEFT_TOUCHED, signal )
{
    [self.stack popBoardAnimated:YES];
}

ON_SIGNAL3( BeeUINavigationBar, RIGHT_TOUCHED, signal )
{
}

- (void)toChat{

}

- (void)loadContent{
    
    
    BeeUIImageView *imgTab = [BeeUIImageView spawn];
    imgTab.frame = CGRectMake(0, self.viewHeight-(IOS7_OR_LATER?64:0)-50, self.viewWidth, 50);
    imgTab.image = IMAGESTRING(@"tab_bg");
    imgTab.contentMode = UIViewContentModeScaleToFill;
    imgTab.userInteractionEnabled = YES;
    [self.view addSubview:imgTab];
    
    BeeUIButton *btn = [BeeUIButton spawn];
    btn.frame = imgTab.bounds;
    [btn setImage:IMAGESTRING(@"send_msg") forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(toChat) forControlEvents:UIControlEventTouchUpInside];
    [imgTab addSubview:btn];

    
    BeeUIWebView *myWebView = [BeeUIWebView spawn];
    myWebView.url = [NSString stringWithFormat:@"%@/activity/myhome/uid/%@/myid/%@",kBaseUrl,self.dictUser[@"uid"],kUserInfo[@"uid"]];
    
    //     myWebView.url = [NSString stringWithFormat:@"http://dev.iheima.com/2/heimaship/index/uid/8377"];
    myWebView.frame = CGRectMake(0, 0, self.viewWidth, self.viewHeight-(IOS7_OR_LATER?64:44)-50);
    [self.view addSubview:myWebView];
    
    
}




- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
